'''
Author: hanlaobo
Date: 2025-10-13 13:01:56
LastEditors: hlb
LastEditTime: 2025-10-15 10:57:17
FilePath: \runoob-test\test.py
'''
# print("hello python")
# # import keyword
# # keyword.kwlist
# # ['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
# #  
# a=1
# if (a>2):
#     print ("真的，是真的")
# else:
#     print ("假的，假的")
#     print ("False")
# #!/usr/bin/python3
 
# str='12345678'
# zheng=5
# fan=3

# # print(str)                 # 输出字符串
# # print(str[0:-1])           # 输出第一个到倒数第二个的所有字符
# # print(str[0])              # 输出字符串第一个字符
# # print(str[2:5])            # 输出从第三个开始到第六个的字符（不包含）
# # print(str[2:])             # 输出从第三个开始后的所有字符
# # print(str[1:5:2])          # 输出从第二个开始到第五个且每隔一个的字符（步长为2）
# # print(str * 2)             # 输出字符串两次
# # print(str + '你好')         # 连接字符串
 
# print('------------------------------')
 
# print('hello\nrunoob')      # 使用反斜杠(\)+n转义特殊字符
# print(r'hello\nrunoob')     # 在字符串前面添加一个 r，表示原始字符串，不会发生转义





# #!/usr/bin/python3
 
# input("\n\n按下 enter 键后退出。")


# import sys 
# print('命令行参数如下:')
# for i in sys.argv:
#     print(i)    
# print('\n\nPython 路径为：', sys.path, '\n')


# for i in range(5):
#     print(i)

# x = 6
# if x > 10:
#     print('x 大于 10')
# else:
#     print('x 小于等于 10')

# a,b= 0,1
# while b < 10:
#     print(b)
#     a,b = b, a+b
# class MyNumbers:
#   def __iter__(self):
#     self.a = 1
#     return self
 
#   def __next__(self):
#     x = self.a
#     self.a += 1
#     return x
 
# myclass = MyNumbers()
# myiter = iter(myclass)
 
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))
# print(next(myiter))


# class MyNumbers:
#   def __iter__(self):
#     self.a = 1
#     return self
  
#   def __next__(self):
#     if self.a <= 20:
#       x = self.a
#       self.a += 1
#       return x
#     else:
#       raise StopIteration
    
# myclass = MyNumbers()
# myiter = iter(myclass)

# for x in myiter:
#   print(x)  


# emptyDict={}
# #打印字典
# print( emptyDict)

# print ("length:",len(emptyDict))


# a=1
# if(a>2):
#     print("真的，是真的")
# else:
#     print("假的，假的")
#     print("False")
# #元组
# type=(1,2,3,4,5)
# #集合
# a={1,2,3,4,5}
# b={4,5,6,7,8}
# print(a|b) #并集
# print(a&b) #交集
# print(a-b) #差集  
# print(a^b) #补集

# fs=frozenset([1,2,3,4,5])
# print(fs)

# fs2 = frozenset([3, 4, 5, 6])   
# print(fs & fs2)
# s={x for x in range(10) if x%2==0}
# print(s)
# lst = [1, 2, 2, 3, 4, 4, 5]
# print(list(set(lst)))
# a=1
# def changea():
#     a=2
#     print('a变成了',a)

# changea()
#匿名函数
# f=lambda:'hello'
# print(f())
# x = lambda x: x + 10
# print(x(5))
# x= lambda x, y : x * y
# print(x(5, 6))

# numbers = [1, 2, 3, 4, 5]
# squared = list(map(lambda x: x**2, numbers))
# print(squared)

# def my_decorator(func):
#     def wrapper():
#         print("在原函数之前执行")
#         func()
#         print("在原函数之后执行")
#     return wrapper

# @my_decorator
# def say_hello():
#     print("Hello!")

# say_hello()


# class Queue:
#     def __init__(self):
#         self.queue=[]
        
#     def enqueue(self,item):
#         self.queue.append(item)

#     def dequeue(self):
#         if not self.is_empty():
#             return self.queue.pop(0)
#         else:
#             raise IndexError("dequeue from empty queue")
    
#     def peek(self):
#         if not self.is_empty():
#             return self.queue[0]
#         else:
#             raise IndexError("peek from empty queue")
    
#     def is_empty(self):
#         return len(self.queue)==0
    
#     def size(self):
#         return len(self.queue)
    
# 测试队列
# q=Queue()
# q.enqueue('a')
# q.enqueue('b')
# q.enqueue('c')
# print(q.peek())     # 输出 'a'
# print(q.size())     # 输出 3

# print(q.dequeue())  # 输出 'a'
# print(q.is_empty()) # 输出 False
# print(q.size())     # 输出 2



# import sys
# print('命令行参数如下:')
# for i in sys.argv:
#     print(i)
# print('\n\nPython 路径为：', sys.path, '\n')


# import support
# support.print_func("Runoob")



# import example

# example.greet()


# import math
# print('常量 PI 的值近似为：%5.3f。' % math.pi)
# 常量 PI 的值近似为：3.142。



# with open('example.py', 'r', encoding='utf-8') as f:
#     content=f.read()
#     print(content)

# import os
# current_directory = os.getcwd()
# print("当前工作目录:", current_directory)

# files_and_dirs = os.listdir()
# print("目录内容:", files_and_dirs)


# class myClass:
#     def __init__(self,value):
#         self.value=value
    
#     def display(self):
#         print("Value is:",self.value)


# obj=myClass(10)
# obj.display()

# a=myClass("hello")
# a.display()


# class people:
#     # 定义基本属性
#     name = ''
#     age = 0
#     #定义私有属性
#     __weight = 0
#     # 定义构造方法
#     def __init__(self,n,a,w):
#         self.name = n
#         self.age = a
#         self.__weight = w
#     def speak(self):
#         print("%s 说: 我 %d 岁。" % (self.name,self.age))

# p = people('runoob',10,30)
# p.speak()

# class student(people):
#     grade = ''
#     def __init__(self,n,a,w,g):
#         #调用父类的构造函数
#         people.__init__(self,n,a,w)
#         self.grade = g
#     #覆写父类的方法
#     def speak(self):
#         print("%s 说: 我 %d 岁了，我在读 %d 年级" % (self.name,self.age,self.grade))

# s = student('ken',10,60,3)
# s.speak()

# class speaker():
#     topic = ''
#     name = ''
#     def __init__(self,n,t):
#         self.name = n
#         self.topic = t
#     def speak(self):
#         print("我叫 %s，我是一个演说家，我演讲的主题是 %s" % (self.name,self.topic))

# class sample(student,speaker):
#     a = ''
#     def __init__(self,n,a,w,g,t):
#         student.__init__(self,n,a,w,g)
#         speaker.__init__(self,n,t)

# test = sample("Tim",25,80,4,"Python")
# test.speak()  # 方法名同，默认调用的是在括号中排前




# class doctor(people):
#     title = ''
#     def __init__(self,n,a,w,t):
#         people.__init__(self,n,a,w)
#         self.title = t
#     def speak(self):
#         print("%s 说: 我 %d 岁了，我是个 %s" % (self.name,self.age,self.title))

# d = doctor('zhang',40,80,'医生')
# d.speak()


# import random
# print(random.choice(['apple', 'pear', 'banana']))


# import time
 
# print('按下回车开始计时，按下 Ctrl + C 停止计时。')
 
# while True:
#     input("")  # 等待用户按下回车开始计时
#     start_time = time.time()  # 记录开始时间
#     print('开始计时...')
 
#     try:
#         while True:
#             elapsed_time = round(time.time() - start_time, 0)  # 计算经过的时间
#             print(f'计时: {elapsed_time} 秒', end="\r")  # 覆盖上次输出
#             time.sleep(1)
#     except KeyboardInterrupt:  # 捕捉 Ctrl + C 中断信号
#         end_time = time.time()  # 记录结束时间
#         total_time = round(end_time - start_time, 2)
#         print(f'\n计时结束，总共时间为: {total_time} 秒')
#         break

# Filename : test.py
# author by : www.runoob.com
 
# def recur_fibo(n):
#    """递归函数
#    输出斐波那契数列"""
#    if n <= 1:
#        return n
#    else:
#        return(recur_fibo(n-1) + recur_fibo(n-2))
 
 
# # 获取用户输入
# nterms = int(input("您要输出几项? "))
 
# # 检查输入的数字是否正确
# if nterms <= 0:
#    print("输入正数")
# else:
#    print("斐波那契数列:")
#    for i in range(nterms):
#        print(i,':',recur_fibo(i))
       

# import xml.etree.ElementTree as ET

# # 定义一个 XML 字符串
# xml_string = '''
# <bookstore>
#     <book>
#         <title>Introduction to Python</title>
#         <author>John Doe</author>
#         <price>29.99</price>
#     </book>
#     <book>
#         <title>Data Science with Python</title>
#         <author>Jane Smith</author>
#         <price>39.95</price>
#     </book>
# </bookstore>
# '''

# # 使用 ElementTree 解析 XML 字符串
# root = ET.fromstring(xml_string)

# # 遍历 XML 树
# for book in root.findall('book'):
#     title = book.find('title').text
#     author = book.find('author').text
#     price = book.find('price').text
#     print(f'Title: {title}, Author: {author}, Price: {price}')


#!/usr/bin/python3
 
# import json
 
# # Python 字典类型转换为 JSON 对象
# data1 = {
#     'no' : 1,
#     'name' : 'Runoob',
#     'url' : 'http://www.runoob.com'
# }
 
# json_str = json.dumps(data1)
# print ("Python 原始数据：", repr(data1))
# print ("JSON 对象：", json_str)
 
# # 将 JSON 对象转换为 Python 字典
# data2 = json.loads(json_str)
# print ("data2['name']: ", data2['name'])
# print ("data2['url']: ", data2['url'])


#!/usr/bin/python3

# import time  # 引入time模块

# ticks = time.time()
# print ("当前时间戳为:", ticks)


# localtime = time.localtime(time.time())
# print ("本地时间为 :", localtime)

# localtime = time.asctime( time.localtime(time.time()) )
# print ("本地时间为 :", localtime)

# # 格式化成2016-03-20 11:45:39形式
# print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))

# # 格式化成Sat Mar 28 22:24:24 2016形式
# print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))
 
# # 将格式字符串转换为时间戳
# a = "Sat Mar 28 22:24:24 2037"
# print (time.mktime(time.strptime(a,"%a %b %d %H:%M:%S %Y")))

# timestamp_ms = int(time.time() * 1000)  # 13位，例如：1728977565000
# print(timestamp_ms)
# # datetime.utcfromtimestamp(2147483648)  # 溢出，返回 1901-12-13 20:45:52

# import copy
# # 浅拷贝
# # li=[1,2,3,[4,5]]
# # li2=copy.copy(li)
# # # print(li2)
# # li[3].append(6)
# # print(li2)
# # 深拷贝
# li=[1,2,3,[4,5]]
# li2=copy.deepcopy(li)
# li[3].append(6)
# print(li)
# print(li2)

# a=100
# # 全局变量
# def test():
#     global a
#     a=200
#     print('a=',a)
# print('a1=',a)
# test()
# print('a1=',a)
# 匿名函数
# 语法：lambda 参数1, 参数2, ...: 表达式
# add=lambda x,y:x+y
# print(add(1,2))

# tua=(1,2,3,4)
# a,b,c,d=tua
# print(a,b,c,d)

# a,*b=tua
# print(a,b)

# def funa():
#     print('funa')
#     raise Exception('funa error')
# try:
#     funa()
# except Exception as e:
#     print(e)

def login ():
    pwd=input('请输入密码：')
    if len(pwd)>=6:
        return '密码符合要求'
    else:
        raise Exception('密码长度不足')
try:
    print(login())
except Exception as e:
    print(e)
